import {
  GET_SWIPER_FN,
  GET_ICON_FN,
  GET_LIST_FN,
  GET_RECOMLIST_FN,
  GET_TARGET_FN,
  GET_SEARCH_FN
} from "./mutations-type";
export default {
  //初始home的swiper
  [GET_SWIPER_FN](state, payload) {
    state.swiperList = payload;
  },
  //首页icons
  [GET_ICON_FN](state, payload) {
    state.iconsList = payload;
  },
  //首页list列表
  [GET_LIST_FN](state, payload) {
    state.homeList = payload;
  },
  //推荐
  [GET_RECOMLIST_FN](state, payload) {
    state.recomList = payload;
  },
  //详情
  [GET_TARGET_FN](state, payload) {
    let obj = state.recomList.find(item => item.id == payload);
    state.targetObj = obj;
  },
  //搜索页面
  [GET_SEARCH_FN](state,payload){
    state.searchList=payload
  }
};
